package com.godot.entity.persistent;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class MsgInfo {

	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	@PrimaryKey
	private Key key;
	
	@Persistent
	private Long created;
	
	@Persistent
	private String msg;
	
	@Persistent
	private Integer permission; //类型
	
	@Persistent
	private String fromGodot;
	
	@Persistent
	private String hostGodot;
	
	public MsgInfo(String msg, int permission, String fromGodot) {
		this.msg = msg;
		this.permission = permission;
		this.fromGodot = fromGodot;
		this.created = System.currentTimeMillis();
	}
	
	public Key getKey() {
		return this.key;
	}
	
	public String getMsg() {
		return this.msg;
	}
	
	public String getFromGodotKey() {
		return this.fromGodot;
	}
	
	public String getHostGodotKey() {
		return this.hostGodot;
	}
}
